import type { LoginUser } from "@/types/login/login";
import { request } from "@/utils/request";
type ResType<T> = {
  code: number;
  result: T;
  message: string;
};
export type User = {
  account: string;
  id: string;
  avatar: string;
  birthday: string;
  gender: string;
  nickname: string;
  mobile: string;
  profession: string;
  provinceCode: string;
  token: string;
};
export const loginAPI = ({ account, password }: LoginUser) => {
  return request<ResType<User>>({
    url: "/login",
    method: "POST",
    data: {
      account,
      password,
    },
  });
};
